<extend name="Public/base"/>
<block name="body">
<div class="panel admin-panel">
  <div class="panel-head" id="add"><strong><span class="icon-pencil-square-o"></span>增加捐款人</strong></div>
  <div class="body-content">
    <form method="post" class="form-x" action="{:U()}">
      <input type="hidden" name="id" value="{$data.id}" />
      <div class="form-group">
        <div class="label">
          <label>昵称：</label>
        </div>
        <div class="field">
          <input type="text" class="input w50" value="{$data.nickname}" name="nickname" data-validate="required:请输入标题" />
          <div class="tips"></div>
        </div>
      </div>
      <div class="clear"></div>
      <div class="form-group">
        <div class="label">
          <label>捐款金额：</label>
        </div>
        <div class="field">
          <input  type="text" class="input" name="money" value="{$data.money}" />
        </div>
      </div>
      <div class="form-group">
        <div class="label">
          <label >手机号：</label>
        </div>
        <div class="field">
          <input type="text" class="input" name="mobile" value="{$data.mobile}"/>
        </div>
      </div>

      <div class="form-group">
        <div class="label">
          <label></label>
        </div>
        <div class="field">
          <button id="send" class="button bg-main icon-check-square-o" type="submit"> 提交</button>
        </div>
      </div>
    </form>
  </div>
</div>
<script>
$(function(){
  var url='ws://192.168.2.11:8000';
  socket=new WebSocket(url);
  socket.onopen=function(){log('连接成功')}
  socket.onmessage=function(msg){log('获得消息:'+msg.data);console.log(msg);}
  socket.onclose=function(){log('断开连接')}

  $("#send").click(function(){
      socket.send('abc');
  });

})
function log(var1){
  $('.log').append(var1+"\r\n");
}

</script>
</block>